package com.basic.business.order.domain;

import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 订单主表 t_orders_main
 *
 * @author zhaoxy_jn@163.com
 */
@Getter
@Setter
public class TOrdersMain implements Serializable {

    private static final long serialVersionUID = 1L;

    /** 系统订单号 */
    private long sid;

    /** 平台订单号 */
    private String tid;

    /** 内部单号 */
    private String shortId;

    /** 店铺名称 */
    private String shopName;

    /** 订单下的商品数量 */
    private long itemNum;

    /** 订单下的商品种类数 */
    private long itemKindNum;

    /** 订单买家已付金额（单位：元） */
    private double payAmount;

    /** 订单系统状态 WAIT_AUDIT【待审核】 SELLER_SEND_GOODS【卖家已发货】 FINISHED【交易完成】 CLOSED【交易关闭】 CANCEL【交易作废】 */
    private String sysStatus;

    /** 快递公司的名称 */
    private String expressCompanyName;

    /** 快递公司的编码 */
    private String expressCode;

    /** 运单号 */
    private String outSid;

    /** 平台上的卖家备注 */
    private String sellerMemo;

    /** 标签id，多个用英文逗号隔开 */
    private String tags;

    /** 处理状态 1自动处理成功 2自动处理失败*/
    private String processStatus;

    /** 处理时间 */
    private long processTime;

    /** 下单时间 */
    private long created;

    /** 支付时间 */
    private long payTime;

    /** 数据更新时间 */
    private long updTime;

    /** 数据接入时间 */
    @JSONField(deserialize = false)
    private long accessTime;

    /** 订单明细集合 */
    private List<TOrdersDetail> detailList = new ArrayList<>(Collections.emptyList());

    /** 订单合并集合 */
    private List<TOrdersMerge> mergeList = new ArrayList<>(Collections.emptyList());

    public TOrdersMain() {
        this.accessTime = System.currentTimeMillis();
    }

    @Override
    public String toString() {
        return "TOrdersMain{" +
                ", sid=" + sid +
                ", tid=" + tid +
                ", shortId='" + shortId + '\'' +
                ", shopName='" + shopName + '\'' +
                ", itemNum=" + itemNum +
                ", itemKindNum=" + itemKindNum +
                ", payAmount=" + payAmount +
                ", sysStatus='" + sysStatus + '\'' +
                ", expressCompanyName='" + expressCompanyName + '\'' +
                ", expressCode='" + expressCode + '\'' +
                ", outSid='" + outSid + '\'' +
                ", sellerMemo='" + sellerMemo + '\'' +
                ", tags='" + tags + '\'' +
                ", processStatus='" + processStatus + '\'' +
                ", processTime=" + processTime +
                ", created=" + created +
                ", payTime=" + payTime +
                ", updTime=" + updTime +
                ", accessTime=" + accessTime +
                ", detailList=" + detailList +
                ", mergeList=" + mergeList +
                '}';
    }

}
